﻿################io编程##############
# f = open("test.txt","r");
# print(f.read());
#减少的f.close的写法
with open("test.txt","r") as f:
	print(f.read());
	
########序列化############3
import pickle;
d = dict(name = "Bob",age = 20, score = 88);
print(d);
strBin = pickle.dumps(d);#序列化
print(strBin)
#将序列化写入文件中
with open("dump.txt","wb") as f:
	pickle.dump(d,f);

with open("dump.txt","r") as f:
	d2 = None;
	pickle.load(f);
print(d2);
